// =================================================================================================
//
//	CopyEngine Framework
//	Copyright 2012 Eran. All Rights Reserved.
//
//	This program is free software. You can redistribute and/or modify it
//	in accordance with the terms of the accompanying license agreement.
//
// =================================================================================================

package copyengine.utils.math.dropEffect
{
    public class CEMathDropItemEffectUtils
    {
        public function CEMathDropItemEffectUtils()
        {
        }

        /**
         *创建一个DropItemEffect的Object,上层逻辑可以通过该对象传入X值然后返回相应的Y值,用于模拟小球掉落时候的震动
         *
         * @param _startMX          最开始跳动抛物线(M点)的X值
         * @param _startMY          最开始跳动抛物线(M点)的Y值
         * @param _decayMX          每次衰减X方向衰减百分比
         * @param _decayMY          每次衰减Y方向衰减百分比
         * @param _decayTime        衰减次数
         *
         * @return                  可以用于Tween函数的Proxy类
         */
        public static function createDropItemEffectObject(_startMX:int,
                                                          _startMY:int,
                                                          _decayMX:Number = 0.3,
                                                          _decayMY:Number = 0.4,
                                                          _decayTime:int = 3):CEDropItemEffectTweenUpdateProxyObject
        {
            var dropItemUpdateObject:CEDropItemEffectTweenUpdateProxyObject = new CEDropItemEffectTweenUpdateProxyObject();
            dropItemUpdateObject.initialize(_startMX, _startMX, _decayMX, _decayMY, _decayTime);
            return dropItemUpdateObject;
        }
    }
}
